<div id="colOne">
    <%= render :partial => "menu" %>
</div>
<div id="colTwo">
<% if @lessons.blank? %>
    <h1>Aktualnie nie ma dost&#281;pnych zaj&#281;c</h1>
<% else %>

<h1>Zajecia</h1>

<table border='0'>
  <tr>
    <th><%= link_to "Przedmiot", :action => 'list_for_subject', :sortby => 'subject' %></th>
    <th><%= link_to "Typ zajęć", :action => 'list_for_subject', :sortby => 'class_type' %></th>
	<th><%= link_to "LGodzNaZaj", :action => 'list_for_subject', :sortby => 'lgodznazaj' %></th>
    <th><%= link_to "LGrZaj", :action => 'list_for_subject', :sortby => 'lgrzaj' %></th>
    <th><%= link_to "LGrRoz", :action => 'list_for_subject', :sortby => 'lgrroz' %></th>
    <th><%= link_to "Semestr", :action => 'list_for_subject', :sortby => 'semestr' %></th>
  </tr>
  
<% for lesson in @lessons %>
  <tr>
    <td><%= link_to "#{lesson.subject.name}", :controller => "lessons_users", :action => "list_for_lesson", :id => lesson.subject.id %></td>
    <td><%=h lesson.class_type.name %></td>
    <td><%=h lesson.lgodznazaj %></td>
    <td><%=h lesson.lgrzaj %></td>
    <td><%=h lesson.lgrroz %></td>
    <td><%=h lesson.semestr %></td>
    
    <td><%= link_to 'Poka&#380;', :action => 'show', :id => lesson %></td>
    <td><%= link_to 'Zmie&#324;', :action => 'edit', :id => lesson %></td>
    <td><%= link_to 'Usu&#324;', { :action => 'destroy', :id => lesson }, :confirm => 'Are you sure?', :post => true %></td>
  </tr>
<% end %>
</table>


<br><br><br>
Click on head of column you want to sort
<br>

<br />
<% end %>
<%= link_to 'Utw&#243;rz nowy', :action => 'new' %>

</div>